/**
 * This software is copyrighted by Bosch Connected Devices and Solutions GmbH, 2016.
 * The use of this software is subject to the XDK SDK EULA
 */

#ifndef BCDS_SENSOR_ERROR_TYPE_H_
#define BCDS_SENSOR_ERROR_TYPE_H_

/* public interface declaration */
#include "BCDS_Retcode.h"
/* public type and macro definitions */

/** Enum values to represent user level sensor error codes */
enum BCDS_SensorErrorType_E
{
    SENSOR_SUCCESS = 0, /**< API call success */
    SENSOR_ERROR = -1, /**< API call failed */
    SENSOR_INVALID_PARAMETER = -2, /**< API call failed due to passing invalid input parameter*/
    SENSOR_UNSUPPORTED_PARAMETER = -3, /**< API call failed due to passing unsupported input parameter*/
    SENSOR_INIT_NOT_DONE = -4, /**< API call failed due to calling other API without calling sensor initialize API*/
};

typedef enum BCDS_SensorErrorType_E BCDS_SensorErrorType_T;

/* public function prototype declarations */

/**
 * @brief        Function responsible to map the return type of sensor API to user error types
 *
 * @param [in]   Sensor API return value which consist of (First 1 MSByte represents Package ID, Next  Byte represents Severity
 *               and Last 2 LSBytes represents error code)
 *
 * @retval       SENSOR_SUCCESS                    Successfully executed API call
 * @retval       SENSOR_ERROR                      Error occurred during API call execution
 * @retval       SENSOR_INVALID_PARAMETER          Error occurred due to invalid input parameter passed to API call
 * @retval       SENSOR_INIT_NOT_DONE              Error indicating the application not called sensor initialization API before calling other API calls
 * @retval       SENSOR_UNSUPPORTED_PARAMETER      Error indicating the input is not supported for this sensor
 */
BCDS_SensorErrorType_T BCDS_getSensorErrorCode(Retcode_T sensorApiReturnValue);

#endif /* BCDS_SENSOR_ERROR_TYPE_H_*/

/**@} */
